package com.china08.yxyapi.repository.db.lectureresult;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import com.china08.yxyapi.entity.db.huodong.lecture.YxyHuodongLectureResultTea;

public interface YxyHuodongLectureResultTeaRepository extends JpaRepository<YxyHuodongLectureResultTea, String> {

    YxyHuodongLectureResultTea findBySchoolIdAndTeaId(String schoolId, String userId);

    Page<YxyHuodongLectureResultTea> findByAreaIdDistrictAndTeaNameContaining(String areaId, String teaName,
            Pageable pageable);

    Page<YxyHuodongLectureResultTea> findByAreaIdDistrict(String areaId, Pageable pageable);

    Page<YxyHuodongLectureResultTea> findByTeaNameContaining(String teaName, Pageable pageable);

    Page<YxyHuodongLectureResultTea> findByAreaIdDistrictAndTeaNameContainingOrSchoolNickContaining(String areaId,
            String teaName, String teaName2, Pageable pageable);

    Page<YxyHuodongLectureResultTea> findByTeaNameContainingOrSchoolNickContaining(String teaName, String teaName2,
            Pageable pageable);

    List<YxyHuodongLectureResultTea> findBySchoolId(String schoolId);

    List<YxyHuodongLectureResultTea> findTop20ByAreaIdDistrictOrderByPackCountDesc(String areaId);

    Integer countByAreaIdDistrict(String areaId);

    Integer countBySchoolId(String sid);

}